﻿using System;

namespace SampleUI
{
    internal static class Common
    {

        public static void WriteError(string error, params object[] args)
        {
            Console.ForegroundColor = ConsoleColor.Red;
            Console.WriteLine(error, args);
            Console.ForegroundColor = ConsoleColor.White;
            Console.WriteLine();
        }

        public static void WriteSuccess(string message, params object[] args)
        {
            Console.ForegroundColor = ConsoleColor.Green;
            Console.WriteLine(message, args);
            Console.ForegroundColor = ConsoleColor.White;
            Console.WriteLine();
        }

        public static void WaitForAnyKey()
        {
            Console.WriteLine();
            Console.ForegroundColor = ConsoleColor.Gray;
            Console.WriteLine("Press Any Key to Continue...");
            Console.ForegroundColor = ConsoleColor.White;
            Console.ReadKey();
        }

        public static void WriteTitle(string title)
        {
            Console.ForegroundColor = ConsoleColor.Cyan;
            Console.WriteLine("+".PadRight(title.Length + 4, '-') + "+");
            Console.WriteLine("| " + title.ToUpper() + " |");
            Console.WriteLine("+".PadRight(title.Length + 4, '-') + "+");
            Console.ForegroundColor = ConsoleColor.White;
            Console.WriteLine();
        }
    }
}
